import { IToolTip } from "../../../../../com/mui/manager/IToolTip";
import { TDramaCopy } from "../../../../../Message/Db/Tables/TDramaCopy";
import { Cache } from "../../../cache/Cache";
import { Language } from "../../../../../extend/language/Language";
import { ItemData } from "../../../resource/info/ItemData";
import { BaseItem } from "../../common/BaseItem";
import { ObjCreate } from "../../common/ObjCreate";
import { ImagesConst } from "../../../resource/ImagesConst";
import { Lv70DramaItem } from "../data/Lv70DramaItem";
import { GTextFiled } from "../../../../../com/mui/controls/GTextFiled";
//class Lv70DramaMapTipsRender
    
    export  class Lv70DramaMapTipsRender /* flash.display.Sprite */ implements IToolTip
    {
        constructor()
        {
            
            this.initView();
            return;
        }

        public set data(arg1)
        {
            var loc10=null;
            var loc11=0;
            if (arg1 == null) 
            {
                return;
            }
            this._data = arg1 as TDramaCopy;
            var loc1=Cache.instance.copy.getLv70HightesHistory(this._data.difficulty);
            var loc2="";
            if (Cache.instance.copy.isLv70DramaTodayDone(this._data.copyCode)) 
            {
                loc2 = "<font color=\'#FE0000\'>(" + Language.getString(80139) + ")</font>";
            }
            this._txtChapter.htmlText = Language.getStringByParam(80132, this._data.titleOne);
            this._txtLayer.htmlText = Language.getStringByParam(80133, this._data.titleTwo) + loc2;
            var loc3=this._data.mainDrop.split("#");
            var loc4=int(loc3[0]);
            var loc5=int(loc3[1]);
            var loc6=int(loc3[2]);
            var loc7=new ItemData(loc4);
            this._mainDrop.itemData = loc7;
            this._mainDrop.amount = 1;
            var loc8=loc5.toString();
            if (loc3.length >= 3) 
            {
                loc8 = loc8 + ("~" + loc6.toString());
            }
            this._txtMainDrop.htmlText = loc7.htmlName + loc8 + Language.getString(80136);
            loc3 = this._data.otherDrop.split("#");
            var loc9=0;
            while (loc9 < 6) 
            {
                (loc10 = this._otherDrops[loc9] as BaseItem).visible = false;
                if (!(loc9 >= loc3.length)) 
                {
                    loc10.visible = true;
                    loc11 = int(loc3[loc9]);
                    loc10.itemData = new ItemData(loc11);
                    loc10.amount = 1;
                }
                ++loc9;
            }
            return;
        }

        /* internal  */initView(): void
        {
            var loc4=null;
            ObjCreate.createBg(0, 0, 355, 200, this, ImagesConst.ToolTipBg);
            ObjCreate.createBg(0, 0, 355, 200, this, ImagesConst.ToolTipBg);
            ObjCreate.createBg(20, 84, 315, 1, this, ImagesConst.SplitLine);
            ObjCreate.createBg(20, 141, 315, 1, this, ImagesConst.SplitLine);
            var loc1=ObjCreate.createGTextField("", 0, 8, 355, 20, this);
            var loc2=loc1.defaultTextFormat;
            loc2.size = 16;
            loc2.align = flash.text.TextFormatAlign.CENTER;
            loc2.bold = true;
            loc1.defaultTextFormat = loc2;
            loc1.htmlText = Language.getString(80131);
            this._txtChapter = ObjCreate.createGTextField("", 20, 38, 300, 20, this);
            this._txtLayer = ObjCreate.createGTextField("", 20, 62, 300, 20, this);
            this._txtMainDrop = ObjCreate.createGTextField("", 126, 107, 200, 20, this);
            loc1 = ObjCreate.createGTextField("", 20, 107, 200, 20, this);
            loc1.htmlText = Language.getString(80135);
            loc1 = ObjCreate.createGTextField("", 20, 167, 200, 20, this);
            loc1.htmlText = Language.getString(80137);
            this._mainDrop = new Lv70DramaItem();
            this._mainDrop.x = 83;
            this._mainDrop.y = 96;
            this.addChild(this._mainDrop);
            this._otherDrops = [];
            var loc3=0;
            while (loc3 < 6) 
            {
                (loc4 = new Lv70DramaItem()).x = 83 + loc3 * 42;
                loc4.y = 154;
                this.addChild(loc4);
                this._otherDrops.push(loc4);
                ++loc3;
            }
            return;
        }

        /* internal */ /* var */_data: TDramaCopy;

        /* internal */ /* var */_txtChapter: GTextFiled;

        /* internal */ /* var */_txtLayer: GTextFiled;

        /* internal */ /* var */_txtMainDrop: GTextFiled;

        /* internal */ /* var */_mainDrop: Lv70DramaItem;

        /* internal */ /* var */_otherDrops: Array<any>;
    }
